import css from './index.module.scss';
import SearchLayout from "layout/search/SearchLayout";
import useShops from "hooks/swr/useShops";

const Page = () => {

    const {shops, loading} = useShops();

    return (
        <SearchLayout title="店铺街">
            <h2>店铺街</h2>
            {
                loading ?
                    <span>loading...</span> :
                    <ul>
                        {
                            shops?.map(item => (
                                <div className="shop" key={item.id}>
                                    <span>id:{item.id}</span>&nbsp;
                                    <span>name:{item.name}</span>
                                </div>
                            ))
                        }
                    </ul>
            }
        </SearchLayout>
    )
}

export default Page;